package com.shixj.ef.constant;

import java.util.regex.Pattern;

/**
 * Created by shixj on 2017/9/21.
 */
public class RegexCons {
    //regex String
    public static final String FULL_URL="^(https?://)?(\\w+(\\.)?)*(:\\d+)?(/((\\.)?(\\?)?=?&?\\w(\\?)?)*)*$";//有效连接url
    public static final String DOMAIN="^(https?://)?(www.)?(\\w+\\.)+\\w+";//域名
    public static final String ALINK="<a[^>]*href=(\"([^\"]*)\"|\'([^\']*)\'|([^\\s>]*))[^>]*>(.*?)</a>";//a连接
    public static final String ALINK_HREF= "href=(\"([^\"]*)\"|\'([^\']*)\'|([^\\s>]*))";//a连接href
    public static final String CHARSET= "charset=\\w+-?\\w( |\")?";//charset
    public static final String CHARSET_VALUE= "\\w+-?\\w";//charset
    //pattern
    public static final Pattern PATTERN_DOMAIN = Pattern.compile(DOMAIN);
    public static final Pattern PATTERN_FULL_URL = Pattern.compile(FULL_URL);
    public static final Pattern PATTERN_ALINK = Pattern.compile(ALINK);
    public static final Pattern PATTERN_ALINK_HREF = Pattern.compile(ALINK_HREF);
    public static final Pattern PATTERN_CHARSET = Pattern.compile(CHARSET);
    public static final Pattern PATTERN_CHARSET_VAULE = Pattern.compile(CHARSET_VALUE);
}
